import time
from datetime import datetime

def generate_doc_id(doc_type):
    """生成入库/出库单据编号"""
    prefix = "IN" if doc_type == "入库" else "OUT"
    return f"{prefix}-{datetime.now().strftime('%Y%m%d')}-{int(time.time())%1000:03d}"

def generate_transfer_id():
    """生成转移单号"""
    return f"TR-{datetime.now().strftime('%Y%m%d')}-{int(time.time())%1000:03d}"